#!/bin/sh
SRC=.
DES=~
SRC_PLUGIN_DIR=$SRC/plugin
SRC_DOC_DIR=$SRC/doc
SRC_VIMRC_FILE=$SRC/vimrc
DES_PLUGIN_DIR=$DES/.vim/plugin
DES_DOC_DIR=$DES/.vim/doc

#install vimrc
if [ -e "$SRC_VIMRC_FILE" ]; then
	echo "Installing $SRC_VIMRC_FILE to $DES/.vimrc ......"
	cp	-f $SRC_VIMRC_FILE		$DES/.vimrc
	echo  "Installed .vimrc."
fi

#install plugins
#test whether ~/.vim ~/ & .vim/plugin .vim/doc dirctory exist?
if [ -d "$DES_PLUGIN_DIR" ]; then
	echo "Installing plugins to $DES/.vim/plugin ...."
	cp	-aRf $SRC_PLUGIN_DIR/*.vim	$DES_PLUGIN_DIR
	echo "Installed plugins."
else
	echo "Create directory ($DES/.vim)"
	mkdir -p $DES/.vim
	echo "Installing plugins to $DES/.vim/plugin ....."
	cp	-aRf $SRC_PLUGIN_DIR	$DES/.vim/
	echo "Installed plugins."
fi
#install doc
